import request from "./request";

export default {
  // 获取考试列表
  getExams() {
    return request({
      url: "/exams",
      method: "get",
    });
  },

  // 获取单个考试信息
  getExam(id) {
    return request({
      url: `/exams/${id}`,
      method: "get",
    });
  },

  // 创建考试
  createExam(data) {
    return request({
      url: "/exams",
      method: "post",
      data,
    });
  },

  // 更新考试信息
  updateExam(id, data) {
    return request({
      url: `/exams/${id}`,
      method: "put",
      data,
    });
  },

  // 删除考试
  deleteExam(id) {
    return request({
      url: `/exams/${id}`,
      method: "delete",
    });
  },
};
